package org.huangrui.design.pattern.decorate;

import org.junit.Test;

import java.io.*;

public class TestIO {
    @Test
    public void test1()throws Exception{
        FileOutputStream fos =new FileOutputStream("d:\\student.obj");
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        ObjectOutputStream oos = new ObjectOutputStream(bos);
        //...省略
    }

    @Test
    public void test2()throws Exception{
        FileOutputStream fos =new FileOutputStream("d:\\student.txt");
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        OutputStreamWriter osw = new OutputStreamWriter(bos);
        BufferedWriter bw = new BufferedWriter(osw);
        //...省略
    }
}
